package com.zmn.oms.third.taobao;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.taobao.api.Constants;
import com.taobao.api.internal.util.StringUtils;
import com.zmn.common.utils.http.HttpUtil;
import com.zmn.oms.third.taobao.dto.TmcComplaintDTO;

import javax.crypto.Mac;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.*;

/**
 * 类描述：
 *
 * @author LiangHailong
 * @date 2019/06/12 16:15
 */
public class TaobaoTmcUtil {

    /**
     * 解析消息体
     * @param jsonData
     * @param tClass
     * @param <T>
     * @return
     */
    public static <T> T parseMessageContent(String jsonData, Class<T> tClass) {
        T resultObj = null;

        String clazzName = tClass.getSimpleName();
        if ("TmcOrderDTO".equals(clazzName)) {
            JSONObject jsonObject = JSON.parseObject(jsonData);
            resultObj = jsonObject.getObject("result", tClass);
        }
        else {
            resultObj = JSON.parseObject(jsonData, tClass);
        }

        // 不知道天猫什么时候对投诉数据结构做了调整，导致识别投诉数据报错了，对投诉数据格式做修正解析  2020.02.02 by lhl
        if ("TmcComplaintDTO".equals(clazzName)) {
            TmcComplaintDTO tmcComplaintDTO = (TmcComplaintDTO)resultObj;
            if (tmcComplaintDTO.getWorkcardId() == null) {
                JSONObject jsonObject = JSON.parseObject(jsonData);
                resultObj = jsonObject.getObject("result", tClass);
            }
        }

        return resultObj;
    }

    public static void main(String[] args) {
        String url="https://oauth.taobao.com/token";
        Map<String,String> props=new HashMap<String,String>();
        props.put("grant_type","authorization_code");
        /*测试时，需把test参数换成自己应用对应的值*/
        props.put("code","a35uOr1ltxU1oC3aW4ixS1T029374936");
        props.put("client_id",TaobaoTmcConstants.APPKEY);
        props.put("client_secret",TaobaoTmcConstants.SECRET);
        props.put("redirect_uri","http://test.xiujiadian.com");
        props.put("view","web");
        String s="";
        try{s=HttpUtil.post(url, props);
            System.out.println(s);
        }catch(Exception e){
            e.printStackTrace();}
    }

    public static String signTopRequest(Map<String, String> params, String secret, String signMethod) throws IOException {
        // 第一步：检查参数是否已经排序
        String[] keys = params.keySet().toArray(new String[0]);
        Arrays.sort(keys);

        // 第二步：把所有参数名和参数值串在一起
        StringBuilder query = new StringBuilder();
        if (Constants.SIGN_METHOD_MD5.equals(signMethod)) {
            query.append(secret);
        }
        for (String key : keys) {
            String value = params.get(key);
            if (StringUtils.areNotEmpty(key, value)) {
                query.append(key).append(value);
            }
        }

        // 第三步：使用MD5/HMAC加密
        byte[] bytes;
        if (Constants.SIGN_METHOD_HMAC.equals(signMethod)) {
            bytes = encryptHMAC(query.toString(), secret);
        } else {
            query.append(secret);
            bytes = encryptMD5(query.toString());
        }

        // 第四步：把二进制转化为大写的十六进制(正确签名应该为32大写字符串，此方法需要时使用)
        return byte2hex(bytes);
    }

    public static byte[] encryptHMAC(String data, String secret) throws IOException {
        byte[] bytes = null;
        try {
            SecretKey secretKey = new SecretKeySpec(secret.getBytes(Constants.CHARSET_UTF8), "HmacMD5");
            Mac mac = Mac.getInstance(secretKey.getAlgorithm());
            mac.init(secretKey);
            bytes = mac.doFinal(data.getBytes(Constants.CHARSET_UTF8));
        } catch (GeneralSecurityException gse) {
            throw new IOException(gse.toString());
        }
        return bytes;
    }

    public static byte[] encryptMD5(String data) throws IOException {
        return encryptMD5(data.getBytes(Constants.CHARSET_UTF8));
    }

    public static byte[] encryptMD5(byte[] data) throws IOException{
        MessageDigest md = null;
        try {
            md = MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException e) {
            throw new IOException(e);
        }
        md.update(data);
        return md.digest();
    }

    public static String byte2hex(byte[] bytes) {
        StringBuilder sign = new StringBuilder();
        for (int i = 0; i < bytes.length; i++) {
            String hex = Integer.toHexString(bytes[i] & 0xFF);
            if (hex.length() == 1) {
                sign.append("0");
            }
            sign.append(hex.toUpperCase());
        }
        return sign.toString();
    }


    public static List<String> getServiceStoreCapacity() {
        List<String> list = new LinkedList<>();
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 4,\"areaCodes\": \"110101|110102|110105|110106|110107|110108|110109|110111|110112|110113|110114|110115|110116|110117|110228|110229\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 2,\"areaCodes\": \"120101|120102|120103|120104|120105|120106|120110|120111|120112|120113|120114|120115|120116|120221|120223|120225\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 7,\"areaCodes\": \"310101|310104|310105|310106|310107|310109|310110|310112|310113|310114|310115|310116|310117|310118|310120|310230\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 5,\"areaCodes\": \"320102|320104|320105|320106|320111|320113|320114|320115|320116|320124|320125\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 2,\"areaCodes\": \"320505|320506|320507|320508|320581|320582|320583|320584|320585\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 4,\"areaCodes\": \"330102|330103|330104|330105|330106|330108|330109|330110|330122|330127|330182|330183|330185\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 2,\"areaCodes\": \"340102|340103|340104|340111|340121|340122|340123|341400|341421\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 2,\"areaCodes\": \"350102|350103|350104|350105|350111|350121|350122|350123|350124|350125|350128|350181|350182\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 0,\"areaCodes\": \"350203|350205|350206|350211|350212|350213\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 2,\"areaCodes\": \"360102|360103|360104|360105|360111|360121|360122|360123|360124\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 2,\"areaCodes\": \"370102|370103|370104|370105|370112|370113|370124|370125|370126|370181\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 3,\"areaCodes\": \"410102|410103|410104|410105|410106|410108|410122|410181|410182|410183|410184|410185\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 5,\"areaCodes\": \"420102|420103|420104|420105|420106|420107|420111|420112|420113|420114|420115|420116|420117\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 2,\"areaCodes\": \"430102|430103|430104|430105|430111|430121|430122|430124|430181\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 4,\"areaCodes\": \"440103|440104|440105|440106|440111|440112|440113|440114|440115|440183|440184\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 8,\"areaCodes\": \"440303|440304|440305|440306|440307|440308\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 3,\"areaCodes\": \"450102|450103|450105|450107|450108|450109|450122|450123|450124|450125|450126|450127\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 4,\"areaCodes\": \"460105|460106|460107|460108\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 4,\"areaCodes\": \"510104|510105|510106|510107|510108|510112|510113|510114|510115|510121|510122|510124|510129|510131|510132|510181|510182|510183|510184|512081\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 1,\"areaCodes\": \"520102|520103|520111|520112|520113|520121|520122|520123|520151|520181\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 3,\"areaCodes\": \"530102|530103|530111|530112|530113|530121|530122|530124|530125|530126|530127|530128|530129|530181\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 4,\"areaCodes\": \"610102|610103|610104|610111|610112|610113|610114|610115|610116|610122|610124|610125|610126\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"50608001\",\"capacity\": 3,\"areaCodes\": \"500101|500102|500103|500104|500105|500106|500107|500108|500109|500112|500113|500114|500115|500222|500223|500224|500225|500226|500227|500228|500229|500230|500231|500232|500233|500234|500235|500236|500237|500238|500240|500241|500242|500243|500381|500382|500383|500384\",\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");

        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"110101|110102|110105|110106|110107|110108|110109|110111|110112|110113|110114|110115|110116|110117|110228|110229\",\"capacity\": 4,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"120101|120102|120103|120104|120105|120106|120110|120111|120112|120113|120114|120115|120116|120221|120223|120225\",\"capacity\": 2,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"310101|310104|310105|310106|310107|310109|310110|310112|310113|310114|310115|310116|310117|310118|310120|310230\",\"capacity\": 7,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"320102|320104|320105|320106|320111|320113|320114|320115|320116|320124|320125\",\"capacity\": 5,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"320505|320506|320507|320508|320581|320582|320583|320584|320585\",\"capacity\": 2,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"330102|330103|330104|330105|330106|330108|330109|330110|330122|330127|330182|330183|330185\",\"capacity\": 4,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"340102|340103|340104|340111|340121|340122|340123|341400|341421\",\"capacity\": 2,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"350102|350103|350104|350105|350111|350121|350122|350123|350124|350125|350128|350181|350182\",\"capacity\": 2,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"350203|350205|350206|350211|350212|350213\",\"capacity\": 0,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"360102|360103|360104|360105|360111|360121|360122|360123|360124\",\"capacity\": 2,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"370102|370103|370104|370105|370112|370113|370124|370125|370126|370181\",\"capacity\": 2,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"410102|410103|410104|410105|410106|410108|410122|410181|410182|410183|410184|410185\",\"capacity\": 3,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"420102|420103|420104|420105|420106|420107|420111|420112|420113|420114|420115|420116|420117\",\"capacity\": 5,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"430102|430103|430104|430105|430111|430121|430122|430124|430181\",\"capacity\": 2,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"440103|440104|440105|440106|440111|440112|440113|440114|440115|440183|440184\",\"capacity\": 4,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"440303|440304|440305|440306|440307|440308\",\"capacity\": 8,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"450102|450103|450105|450107|450108|450109|450122|450123|450124|450125|450126|450127\",\"capacity\": 3,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"460105|460106|460107|460108\",\"capacity\": 4,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"510104|510105|510106|510107|510108|510112|510113|510114|510115|510121|510122|510124|510129|510131|510132|510181|510182|510183|510184|512081\",\"capacity\": 4,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"520102|520103|520111|520112|520113|520121|520122|520123|520151|520181\",\"capacity\": 1,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"530102|530103|530111|530112|530113|530121|530122|530124|530125|530126|530127|530128|530129|530181\",\"capacity\": 3,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"610102|610103|610104|610111|610112|610113|610114|610115|610116|610122|610124|610125|610126\",\"capacity\": 4,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");
        list.add("{\"categoryIds\": \"127332019\",\"areaCodes\": \"500101|500102|500103|500104|500105|500106|500107|500108|500109|500112|500113|500114|500115|500222|500223|500224|500225|500226|500227|500228|500229|500230|500231|500232|500233|500234|500235|500236|500237|500238|500240|500241|500242|500243|500381|500382|500383|500384\",\"capacity\": 3,\"capacityType\": \"0\",\"dailyCapacity\":\"\"}");

        return list;
    }

    public static String getCleanString() {
        /*
        categoryIds字段对应：
            家电清洗appliance_cleaning :127332019
            空调清洗air_conditioner_cleaning :50608001
            家电维修new_retail_home_appliance_repair:127292018
            空调安装new_retail_air_condition_install:127292018
        */
        String code_cleaning = "[{\"categoryIds\": \"50608001|127332019\",\"areaCodes\": \"110100|120100|310100|320100|320500|330100|340100|350100|350200|360100|370100|410100|420100|430100|440100|440300|450100|460100|500100|510100|520100|530100|610100\",\"capacity\": 0,\"capacityType\": \"1\",\"dailyCapacity\":[{\"capacity\": \"500\",\"daily\": \"2021-3-2\"},{\"capacity\": \"500\",\"daily\": \"2021-3-3\"},{\"capacity\": \"500\",\"daily\": \"2021-3-4\"},{\"capacity\": \"500\",\"daily\": \"2021-3-5\"},{\"capacity\": \"500\",\"daily\": \"2021-3-6\"},{\"capacity\": \"500\",\"daily\": \"2021-3-7\"},{\"capacity\": \"500\",\"daily\": \"2021-3-8\"},{\"capacity\": \"500\",\"daily\": \"2021-3-9\"},{\"capacity\": \"500\",\"daily\": \"2021-3-10\"},{\"capacity\": \"500\",\"daily\": \"2021-3-11\"},{\"capacity\": \"500\",\"daily\": \"2021-3-12\"},{\"capacity\": \"500\",\"daily\": \"2021-3-13\"},{\"capacity\": \"500\",\"daily\": \"2021-3-14\"},{\"capacity\": \"500\",\"daily\": \"2021-3-15\"},{\"capacity\": \"500\",\"daily\": \"2021-3-16\"},{\"capacity\": \"500\",\"daily\": \"2021-3-17\"},{\"capacity\": \"500\",\"daily\": \"2021-3-18\"},{\"capacity\": \"500\",\"daily\": \"2021-3-19\"},{\"capacity\": \"500\",\"daily\": \"2021-3-20\"},{\"capacity\": \"500\",\"daily\": \"2021-3-21\"},{\"capacity\": \"500\",\"daily\": \"2021-3-22\"},{\"capacity\": \"500\",\"daily\": \"2021-3-23\"},{\"capacity\": \"500\",\"daily\": \"2021-3-24\"},{\"capacity\": \"500\",\"daily\": \"2021-3-25\"},{\"capacity\": \"500\",\"daily\": \"2021-3-26\"},{\"capacity\": \"500\",\"daily\": \"2021-3-27\"},{\"capacity\": \"500\",\"daily\": \"2021-3-28\"},{\"capacity\": \"500\",\"daily\": \"2021-3-29\"},{\"capacity\": \"500\",\"daily\": \"2021-3-30\"},{\"capacity\": \"500\",\"daily\": \"2021-3-31\"},{\"capacity\": \"500\",\"daily\": \"2021-4-1\"},{\"capacity\": \"500\",\"daily\": \"2021-4-2\"},{\"capacity\": \"500\",\"daily\": \"2021-4-3\"},{\"capacity\": \"500\",\"daily\": \"2021-4-4\"},{\"capacity\": \"500\",\"daily\": \"2021-4-5\"},{\"capacity\": \"500\",\"daily\": \"2021-4-6\"},{\"capacity\": \"500\",\"daily\": \"2021-4-7\"},{\"capacity\": \"500\",\"daily\": \"2021-4-8\"},{\"capacity\": \"500\",\"daily\": \"2021-4-9\"},{\"capacity\": \"500\",\"daily\": \"2021-4-10\"},{\"capacity\": \"500\",\"daily\": \"2021-4-11\"},{\"capacity\": \"500\",\"daily\": \"2021-4-12\"},{\"capacity\": \"500\",\"daily\": \"2021-4-13\"},{\"capacity\": \"500\",\"daily\": \"2021-4-14\"},{\"capacity\": \"500\",\"daily\": \"2021-4-15\"},{\"capacity\": \"500\",\"daily\": \"2021-4-16\"},{\"capacity\": \"500\",\"daily\": \"2021-4-17\"},{\"capacity\": \"500\",\"daily\": \"2021-4-18\"},{\"capacity\": \"500\",\"daily\": \"2021-4-19\"},{\"capacity\": \"500\",\"daily\": \"2021-4-20\"},{\"capacity\": \"500\",\"daily\": \"2021-4-21\"},{\"capacity\": \"500\",\"daily\": \"2021-4-22\"},{\"capacity\": \"500\",\"daily\": \"2021-4-23\"},{\"capacity\": \"500\",\"daily\": \"2021-4-24\"},{\"capacity\": \"500\",\"daily\": \"2021-4-25\"},{\"capacity\": \"500\",\"daily\": \"2021-4-26\"},{\"capacity\": \"500\",\"daily\": \"2021-4-27\"},{\"capacity\": \"500\",\"daily\": \"2021-4-28\"},{\"capacity\": \"500\",\"daily\": \"2021-4-29\"},{\"capacity\": \"500\",\"daily\": \"2021-4-30\"}]}]";

        return code_cleaning;
    }

    public static String getRepairString() {
        /*
        categoryIds字段对应：
            家电清洗appliance_cleaning :127332019
            空调清洗air_conditioner_cleaning :50608001
            家电维修new_retail_home_appliance_repair:127292018
            空调安装new_retail_air_condition_install:127292018
        */
        String code_repair = "[{\"categoryIds\": \"127292018|127292018\",\"areaCodes\": \"130100|130200|130300|130400|130500|130600|130700|130800|130900|131000|131100|310100|320100|320200|320300|320400|320500|320600|320700|320800|320900|321000|321100|321200|321300|330100|330200|330300|330400|330500|330600|330700|330800|330900|331000|331100|340100|340200|340300|340400|340500|340600|340700|340800|341000|341100|341200|341300|341500|341600|341700|341800|350100|350200|350300|350400|350500|350600|350700|350800|350900|370100|370200|370300|370400|370500|370600|370700|370800|370900|371000|371100|371200|371300|371400|371500|371600|371700|410100|410200|410300|410400|410500|410600|410700|410800|410900|411000|411100|411200|411300|411400|411500|411600|411700|500100|510100|510300|510400|510500|510600|510700|510800|510900|511000|511100|511300|511400|511500|511600|511700|511800|511900|512000\",\"capacity\": 0,\"capacityType\": \"1\",\"dailyCapacity\":[{\"capacity\": \"10000\",\"daily\": \"2021-3-2\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-3\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-4\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-5\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-6\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-7\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-8\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-9\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-10\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-11\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-12\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-13\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-14\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-15\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-16\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-17\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-18\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-19\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-20\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-21\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-22\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-23\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-24\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-25\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-26\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-27\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-28\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-29\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-30\"},{\"capacity\": \"10000\",\"daily\": \"2021-3-31\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-1\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-2\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-3\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-4\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-5\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-6\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-7\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-8\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-9\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-10\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-11\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-12\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-13\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-14\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-15\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-16\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-17\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-18\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-19\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-20\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-21\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-22\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-23\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-24\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-25\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-26\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-27\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-28\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-29\"},{\"capacity\": \"10000\",\"daily\": \"2021-4-30\"}]}]";

        return code_repair;
    }
}
